package com.xinyou.u8c.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinyou.u8c.entity.BdDeptdoc;
import com.xinyou.u8c.mapper.BdDeptdocMapper;
import com.xinyou.u8c.result.JsonResult;
import com.xinyou.u8c.service.IBdDeptdocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author pxm
 * @since 2023-04-04
 */
@RestController
@RequestMapping("/u8c/bd-deptdoc")
public class BdDeptdocController {
    @Autowired
    private IBdDeptdocService bdDeptdocService;

    @PostMapping("/history")
    public JsonResult getHistory() {
        LambdaQueryWrapper<BdDeptdoc> queryWrapper=new LambdaQueryWrapper();
        queryWrapper.orderByAsc(BdDeptdoc::getDeptcode);
        Page<BdDeptdoc> pageWhere=new Page<>(1,20);
        IPage<BdDeptdoc> pageData= bdDeptdocService.page(pageWhere,queryWrapper);
        return new JsonResult(true,pageData);
    }
}
